﻿using ChessGame.Movement;
using ChessGame.Pieces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessGame.Movement
{

    public class AIMovement
    {
        public bool hit;
        public int ownValue;
        public int enemyValue;
        public Chesspiece chesspiece;
        public Chesspiece enemypiece;
        public MovementOption movementOption;

        public int EndPositionX
        {
            get { return (chesspiece.PositionX + movementOption.X); }
        }

        public int EndPositionY
        {
            get { return (chesspiece.PositionY + movementOption.Y); }
        }

        public AIMovement(bool _hit, Chesspiece _chesspiece, Chesspiece _enemypiece)
        {
            hit = _hit;
            ownValue = _chesspiece.PieceValue;
            enemyValue = _enemypiece.PieceValue;
            chesspiece = _chesspiece;
            enemypiece = _enemypiece;
        }
        public AIMovement(bool _hit, Chesspiece _chesspiece, MovementOption _option)
        {
            hit = _hit;
            ownValue = _chesspiece.PieceValue;
            enemyValue = 0;
            chesspiece = _chesspiece;
            movementOption = _option;
        }

        public int MovementScore()
        {
            int value;
            if (hit)
            {
                value = (ownValue - enemyValue);
            }
            else
            {
                value = enemyValue - ownValue;
            }
            return value;
        }

    }
}
